package com.atswust.shake.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.util.Date;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;

import javax.validation.constraints.*;

/**
 * 
 * @TableName student
 */
@TableName(value ="student")
@Data
@AllArgsConstructor
@Builder
public class Student  {
    /**
     * 自增主键
     *
     */
    @TableId(value = "id",type = IdType.AUTO)
    @Null(message = "id必须为空")
    private Integer id;
    /**
     * 昵称
     */
    @NotBlank(message = "必须有名字")
    @Size(min = 2,max = 5,message = "姓名长度在2-5之间")
    private String name;

    /**
     * 性别
     */
    @Max(value = 1,message ="性别只有0和1" )
    @PositiveOrZero
    private Integer gender;

    /**
     * 账号
     */
    @NotBlank
    @Size(min = 10 ,max = 10)
    private String account;

    /**
     * 密码
     */
    @NotBlank(message="密码不能位空")
    @Size(min = 6 ,max = 12,message = "密码长度在6-12位")
    private String password;

    /**
     * 学院
     */
    private String college;

    /**
     * 年级
     */
    private String grade;

    /**
     * 摇一摇时间
     */
    private Date shakeTime;
}